<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=utf-8"%>
<%@ page import="shopping.Goods"%>
<%@ page import="connection.GoodsDAO"%>
<%@ page import="shopping.Action"%>

<title>My JSP 'showgoods.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="css/showgoods_style.css" type="text/css" rel="stylesheet">
<style type="text/css">
.commodity {
	float: left;
	margin: 10px;
}

div dd {
	margin: 0px;
	font-size: 10pt;
}

.dd_price {
	color: #cc2222;
	font-size: 18px;
	font-family: "Courier New", Courier, mono;
	font-weight: 200;
}

div dd.dd_name {
	color: #222222;
	font-size: 15px;
}

div dd.dd_city {
	margin-top: 5px;
	color: blue;
}
</style>
</head>

<body>
	<div class="heading">
		<div class="font-face">
			<h3>商品展示</h3>
		</div>
	</div>
	<div class="heading">
		<h4>
			<a href="account.jsp?">去购物车结算!</a>
		</h4>
	</div>
	<div class="heading0">
		<h4>
			<a href="enter.jsp?">退出登录！</a>
		</h4>
	</div>

	<br />

	<hr />
	<hr />
	<br />
	<div class="body_show">


		<div class="center">
			<!-- 商品循环开始 -->
			<%
				GoodsDAO goodsDao = new GoodsDAO();
				ArrayList<Goods> list = goodsDao.getAllGoods();
				if (list != null && list.size() > 0) {
					for (int i = 0; i < list.size(); i++) {
						Goods good = list.get(i);
						System.out.print(good);
			%>
			<div class="commodity">
				<dl>
					<dt>
						<img src="picture/<%=good.getPicture()%>" width="200" height="160"
							border="1" />
					</dt>
					<dd class="dd_price">
						￥<%=good.getPrice()%>.00
					</dd>
					<dd class="dd_name"><%=good.getName()%></dd>
					<dt>
						<input type="image" src="picture/28.png"
							onClick="window.location.href='AddToCart.jsp?id=<%=good.getNum()%>'"
							width="101px" height="41px" />

					</dt>
				</dl>
			</div>

			<!-- 商品循环结束 -->
			<%
				}
				}
			%>
		</div>



	</div>
	<div class="footing"></div>
</body>
</html>

